#pragma once

#include <windows.h>
#include "vrdatacore_global.h"
#include "effectbase.h"
#include <osg\StateSet>

namespace VrDataCore
{
	class VRDATACORE_EXPORT VideoEffect:public EffectBase
	{
	public:
		VideoEffect();
	public:
		virtual void buildPropertyMap();
		virtual void apply(CoreBase::ActorBase* actor);
		virtual void unApply(CoreBase::ActorBase* actor);
		bool loadVideo(const std::string& videoname );
		bool isFlip();
		int getVideoWidth();
		int getVideoHeight();
		double getVideoLength();
		bool isPlaying();
		void setLoop(bool b);
	protected:
		~VideoEffect();
		bool															_fadeIn;
	private:
		osg::ref_ptr< osg::StateSet>									_videoStateSet ;
		std::string														_videoName ;
		bool															_videoLoadSuccess ;
		osg::ref_ptr<osg::Image>										_image;
		osg::Drawable*													_drawable;
		bool															_loop;
	};
}